<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="userList.title"/></title>
    <meta name="menu" content="AdminMenu"/>
</head>

<div>
    <h2><fmt:message key="userLdapList.heading"/></h2>
    
	<form method="get" action="${ctx}/admin/addAll" id="addForm" class="form-search">
	<div style="margin-left:5%;">
	<s:submit type="button" cssClass="btn btn-primary" method="addAll" key="button.save" theme="simple">
                <i class="icon-ok icon-white"></i>
                Agregar todos los usuarios
    </s:submit>
    </div>
    </form>
    
    <form method="get" action="${ctx}/admin/ldapUsers" id="searchForm" class="form-search">
    <div id="search" class="input-append">
        <input type="text" size="20" name="q" id="query" value="${param.q}"
               placeholder="<fmt:message key="search.enterTerms"/>" class="input-medium search-query"/>
        <button id="button.search" class="btn" type="submit">
            <i class="icon-search"></i>
            <fmt:message key="button.search"/>
        </button>
    </div>
    </form>

    
    <display:table name="users" cellspacing="0" cellpadding="0" requestURI=""
                   defaultsort="1" id="users" pagesize="100" class="table table-condensed table-striped table-hover" export="true">
        <display:column titleKey="user.photo" style="width: 15%" media="html">
        				<img src="${ ctx }/thumbnailPhotoLdap?username=${ users.username }"/>
        </display:column>           
        <display:column property="username" escapeXml="true" sortable="true" titleKey="user.username" style="width: 20%"
                        url="/admin/editLdapUser?from=listldap" paramId="username" paramProperty="username"/>
        <display:column titleKey="activeUsers.fullName" sortable="true" style='width: 34%'>
            <c:out value="${users.name}" escapeXml="true"/>
            <c:if test="${not empty users.email}">
                <a href="mailto:<c:out value="${users.email}"/>">
                    <img width="16px" src="<c:url value="/images/iconEmail.png"/>"
                         alt="<fmt:message key="icon.email"/>" class="icon"/></a>
            </c:if>
        </display:column>
        <display:column property="department" sortable="true" titleKey="user.department" style="width: 15%" autolink="true"
                        media="html"/>
        <display:column property="telephone" sortable="true" titleKey="user.phone" style="width: 25%" autolink="true"
                        media="html"/>
        <display:column property="email" titleKey="user.email" media="csv xml excel pdf"/>

        <display:setProperty name="paging.banner.item_name"><fmt:message key="userList.user"/></display:setProperty>
        <display:setProperty name="paging.banner.items_name"><fmt:message key="userList.users"/></display:setProperty>

        <display:setProperty name="export.excel.filename" value="User List.xls"/>
        <display:setProperty name="export.csv.filename" value="User List.csv"/>
        <display:setProperty name="export.pdf.filename" value="User List.pdf"/>
    </display:table>
</div>
